﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.International.Converters.PinYinConverter;
using System.IO;
using System.Runtime.Serialization.Json;

namespace DYSales.Web
{
    public class totalObject
    {
        public decimal to_总营业金额 { get; set; }
        public decimal to_支出总金额 { get; set; }
        public decimal to_商品成本总金额 { get; set; }
        public string to_统计时间 { get; set; }
        public string to_统计范围 { get; set; }
        public decimal to_营业结算 { get; set; }
        public decimal to_商品利润结算 { get; set; }
        public decimal to_现金支付金额 { get; set; }
        public decimal to_刷卡支付金额 { get; set; }
    }

    public class totalclass
    {
        public decimal to_总营业金额 { get; set; }
        public decimal to_现金支付金额 { get; set; }
        public decimal to_刷卡支付金额 { get; set; }
        public string to_交班时间 { get; set; }
        public string to_统计范围 { get; set; }
        public string to_操作员 { get; set; }
    }

    public class other
    {
        internal static string GetFirstPinyin(string str)
        {
            string r = string.Empty;
            foreach (char obj in str)
            {
                if (ChineseChar.IsValidChar(obj))
                {
                    ChineseChar chineseChar = new ChineseChar(obj);
                    if (!chineseChar.IsPolyphone)
                    {
                        r += chineseChar.Pinyins[0].Substring(0, 1);
                    }
                    else
                    {
                        r += chineseChar.Pinyins[chineseChar.PinyinCount - 1].Substring(0, 1);
                    }
                }
                else
                {
                    r += obj.ToString();
                }
            }
            return r;
        }

    }
}